import axios from '@/http/axios'
export default{
    namespaced:true,
    state:{
        commentData:[],
    },
    getters:{},
    mutations:{
        setCommentData(state,data){
            state.commentData=data
        },
    },
    actions:{
        async toPublishComments(context,params){
            return await axios.get('/comment/commentExamine?commentid='+params)
        },
        async toRefuseComments(context,params){
            return await axios.get('/comment/commentRefuseExamine?commentid='+params)
        },
        async toDeleteComments(context,params){
            return await axios.get('/comment/deleteById?id='+params)
        },
        async toLoadComments(context,params){
            let res = await axios.post('/comment/query',params)
            context.commit('setCommentData',res.data.data)
        }
    }
}